package com.example.enjoylearning.view

import android.app.Dialog
import android.content.Context
import android.util.Log
import com.example.enjoylearning.R

/**
 * @Author ninetailedfox
 * @Data 2022/10/30 12:52 下午
 * @ClassName LoadingDialog
 **/
object LoadingDialog {

    private var dialog: Dialog? = null

    fun show(context: Context) {
        cancle()
        dialog = Dialog(context, R.style.Theme_EnjoyLearning)
        dialog?.let {
            it.setContentView(R.layout.dialog_loading)
            it.setCancelable(false)
            it.setCanceledOnTouchOutside(false)
            it.show()
        }
    }

    fun cancle() {
        dialog?.dismiss()
    }
}